UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'buAZCDjU9Y17KMogkxCjQdPIIUk0zm5lZBFyt6d2LVQ=' 
WHERE 
  key_id = '6f670be97edd8b7db7a6f7f84acda68f3527d5be08ad3b3dc173b8db1f56b23d' 
  AND (
    token = 'buAZCDjU9Y17KMogkxCjQdPIIUk0zm5lZBFyt6d2LVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017