UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FbIZA5foIprSoYLXNo8mDYkMzvcgcXhpB9/Iel2UFLs=' 
WHERE 
  key_id = '95ef48b645db1fc8ee5d0d13294ba36bccd15e20e93d78ff39ae084965800475' 
  AND (
    token = 'FbIZA5foIprSoYLXNo8mDYkMzvcgcXhpB9/Iel2UFLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040