UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RzlD4bsVHQL6EUNZhPQ/ZWr0qcFsbV7oUIYDeATBLjI='
WHERE
key_id = 'f95dec8ec0e83f06d979dbd32c3ae24b6d2af9465a5c6a55115b8f55511f6366'
AND (
token = 'RzlD4bsVHQL6EUNZhPQ/ZWr0qcFsbV7oUIYDeATBLjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)