UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tycU7VOHx/xZjr+NrpT1PThsD+Q2rrpWO7vMVy2OPMU='
WHERE
key_id = '32e45b90043750cf07043d9ed4ac3338751742d50bbd0959f8d2061ad622cba1'
AND (
token = 'tycU7VOHx/xZjr+NrpT1PThsD+Q2rrpWO7vMVy2OPMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)