UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BITjoY4RFSUm4HAMeTfE1R7Yp/d+rMjVbDfW53BSQOI=' 
WHERE 
  key_id = 'e766f76df965d2000d1319b11e9a6c66587baa62ec3abbb7453876bcd5d1d3d7' 
  AND (
    token = 'BITjoY4RFSUm4HAMeTfE1R7Yp/d+rMjVbDfW53BSQOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040