UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e9VOTKjhrRf3nSyT4+bURKxbk6+EAL0CRI6PkgR2t2g=' 
WHERE 
  key_id = '07a71c9823cea9197f01c03451526327b0093043507fa2d6bc0e55c179af060c' 
  AND (
    token = 'e9VOTKjhrRf3nSyT4+bURKxbk6+EAL0CRI6PkgR2t2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019