UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'euTAa5KbTD/SY9tYBi5edUWvao2Xt+vnpGsM8OzVaFs='
WHERE
key_id = 'cdfd8decc9d877213759dd9050802877faccf967d70f995d087db547dca4e4f0'
AND (
token = 'euTAa5KbTD/SY9tYBi5edUWvao2Xt+vnpGsM8OzVaFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)