UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0svBjlPGfNfUu2zlR1YNhd7+5/FhxDsEDiz4myRHgI4=' 
WHERE 
  key_id = '7aedaa2e6e397c2c834ff11048941311d26b6c9d8e0b5b392426818686c72db8' 
  AND (
    token = '0svBjlPGfNfUu2zlR1YNhd7+5/FhxDsEDiz4myRHgI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033