UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5PTz3oeDVOE29AxIJUb6hkHbbls9W9EfVYHqpwqgmaY=' 
WHERE 
  key_id = 'a4eed380d4309cbe40d6f1454bb6aac3f2f625ef688cde65cb1ada90f1171461' 
  AND (
    token = '5PTz3oeDVOE29AxIJUb6hkHbbls9W9EfVYHqpwqgmaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033