UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W+1OuDpQ05n6kYqVwSvs+6VKBCDQA8gTON6S8pS2RNA='
WHERE
key_id = 'd577454c2a9bda3b26226b765f101e847419bea52495ac5ba455e2999782685d'
AND (
token = 'W+1OuDpQ05n6kYqVwSvs+6VKBCDQA8gTON6S8pS2RNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)