UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nbkt0qbaTmJ0/uixyiGjkH+Rwj4R8mShVRdJvg0iCY8='
WHERE
key_id = 'bb98255ecc60fb002a905f974b7564f290a4ce55a2d22f44d7ee252367cad844'
AND (
token = 'Nbkt0qbaTmJ0/uixyiGjkH+Rwj4R8mShVRdJvg0iCY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)