UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Q3aA3+qj6zpCQIx0jJgLC4/i9XzRGLm2SDKipfq+Ds=' 
WHERE 
  key_id = '0261e874babaedf5e1b07f5d2544e85241eabdba9c9f7fa05cbc9a70d3c8dfcb' 
  AND (
    token = '7Q3aA3+qj6zpCQIx0jJgLC4/i9XzRGLm2SDKipfq+Ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027