UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JzemoNmx3GmUiZgZ5fcB0x5nvEQAdo38C8DzmivZv0=' 
WHERE 
  key_id = '6dbbb8d4ab4d26fb95a253cf1e97ab62b0b85bd07fcc62143fddbbe4e2df2d82' 
  AND (
    token = '5JzemoNmx3GmUiZgZ5fcB0x5nvEQAdo38C8DzmivZv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026