UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't5rhFTbqu7xWTstICGOFCraWCkhFhsVeT+1fjBVfuBY=' 
WHERE 
  key_id = '4187c97003c5b6ea1f7385c02bd44945227524f742b84de96d5417fcbe1057b6' 
  AND (
    token = 't5rhFTbqu7xWTstICGOFCraWCkhFhsVeT+1fjBVfuBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033