UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ApI+JpObuEa9sl7F+HY80FOVbcye7gi/UTe5rBLpBU='
WHERE
key_id = '56d7d903909e1cfc4dcfe2168ef203660b7c3e225166041753515d911ac29592'
AND (
token = '7ApI+JpObuEa9sl7F+HY80FOVbcye7gi/UTe5rBLpBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)