UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CJGqBZcDE3oPbJcdu2E7LitYeaJbv3dBUXyvA0eoBnQ=' 
WHERE 
  key_id = '9f05b27a2a1e3ff84da0d284743d20c4b6d402adf703d81e07e9a829678e92d7' 
  AND (
    token = 'CJGqBZcDE3oPbJcdu2E7LitYeaJbv3dBUXyvA0eoBnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034