UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RgIyuC6oYPcR4cnEFOG+1d4Yu8qjID+jLKu5ivTXKwI='
WHERE
key_id = 'f4ff898238d99875669377514d6ba7223d2233050bb51e9692784422a0f07618'
AND (
token = 'RgIyuC6oYPcR4cnEFOG+1d4Yu8qjID+jLKu5ivTXKwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)