UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rth2UeSbziwbrYtHXK+DhfsBdVWz8VCv7ZZbaXeWlms=' 
WHERE 
  key_id = '9a3a1799a348a3efa08c2854ad82e5cf9e4ef47cf8bac2ab7542e7ee7440ae18' 
  AND (
    token = 'Rth2UeSbziwbrYtHXK+DhfsBdVWz8VCv7ZZbaXeWlms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071