UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yXLmh9HvnWPRoQ7aMeVolUcRwxkF65fBTby8o3E+/Mc='
WHERE
key_id = '3c0f51a6f500b7b313b9ef195bbb8213db9c5e6dfe85c88c7eba54fa57ba104a'
AND (
token = 'yXLmh9HvnWPRoQ7aMeVolUcRwxkF65fBTby8o3E+/Mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)