UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CHHdXQdqVgVaHRbaSl3PwDSzMdv4mm/edEgzsNjcSm4=' 
WHERE 
  key_id = '6c4a4f3fd7e4d500c73ebf52bf5efeba9be5624230c8ef06f50b7f785bc4096c' 
  AND (
    token = 'CHHdXQdqVgVaHRbaSl3PwDSzMdv4mm/edEgzsNjcSm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.01667