UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IFhC5JNV000+mNEfTogYkdTpN3t5jqOryOju8PJxeKI='
WHERE
key_id = 'e0debf80606d1739cf3f76cc17eb76421758ff3c412150d010af37298c7b9d9e'
AND (
token = 'IFhC5JNV000+mNEfTogYkdTpN3t5jqOryOju8PJxeKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)