UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eGhV9MwKbQg9KfPfd8+jV9uyiBRhSBOl8Adg0bubMvs='
WHERE
key_id = '52da0bda2b6c68e179e83734f837ecfc775dfc2314531db6ef80f981955841c3'
AND (
token = 'eGhV9MwKbQg9KfPfd8+jV9uyiBRhSBOl8Adg0bubMvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)