UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5QNYTWt/wBpbl6bAVKSpMqqKmQe9Cixk2sqDkIsmhCg='
WHERE
key_id = '1e0411d26f38366e99d61b3083ab562022d2f1aca817487b9a53340450b194fc'
AND (
token = '5QNYTWt/wBpbl6bAVKSpMqqKmQe9Cixk2sqDkIsmhCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)