UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lr6LSD81uLwafigWBFD3ANnhwiMwi3QvnmXwgktzI3I=' 
WHERE 
  key_id = '744ff81c4dc5489fafe2b710c3e987f343b1bbd5f8289900969c56dcdd0aa924' 
  AND (
    token = 'Lr6LSD81uLwafigWBFD3ANnhwiMwi3QvnmXwgktzI3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069