UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SfwLgS166T3B1lkMJWMXu2rcl3DgXCoTf+v0/6eARGY='
WHERE
key_id = 'e0c6019cb97c67e10ff3ae61789573a1e1dd16ea13171053324fb0d86944d92b'
AND (
token = 'SfwLgS166T3B1lkMJWMXu2rcl3DgXCoTf+v0/6eARGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)