UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nGGkXDQTMlrXFaqmhuk/I6PJpSxKDOowKlci9ECQoU=' 
WHERE 
  key_id = '04080e9cdf4afdf77b2468813fd8f1c91d3256848442b5b7ede61f8c9fc21af0' 
  AND (
    token = '4nGGkXDQTMlrXFaqmhuk/I6PJpSxKDOowKlci9ECQoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028